<template>
  <div class="newnotice">
    <div class="notice-item" v-for="(item,index) in list" :key="index" @click="goInfo(item.id)">
        <p>{{item.title}}</p>
        <p>{{item.publish_time}}</p>
    </div>
  
  </div>
</template>
<script>
import { noticeList } from "../../api/user";
export default {
  data() {
    return {
      isfull: false,
      list: []
    };
  },
  methods: {
    getData() {
      noticeList().then(res => {
        this.list = res.data;
      });
    },
    goInfo(id) {
      this.$router.push({
        path:'/noticeinfo',
        query:{
          id:id
        }
      })
    }
  },
  created() {
    this.getData();
  }
};
</script>
<style lang="scss">
.newnotice {
  width: 100%;
  background-color: #f5f5f5;
  header {
    color: #fff;
  }
  .notice-item {
      display: flex;
      display: -webkit-flex;
      width: 100%;
      margin-bottom: 8px;
      background-color: #fff;
    //   height: 45px;
    padding: 10px 15px;
      justify-content: space-around;
      flex-direction: column;
      p:last-child {
          text-align: right;
      }
      p {
          font-size: 14px;
      }
  }
}
</style>


